package com.suray.socket;

import com.suray.socket.core.NetAddress;
import com.suray.socket.type.SocketType;

import java.util.Map;
import java.util.Set;

public interface ISocketCreate {

    /**
     * 添加socket
     *
     * @param socketId
     * @param ip
     * @param port
     * @param socketType
     * @return
     */
    SocketInterface addSocket(int socketId, String ip, int port, SocketType socketType);

    void checkNetAddress(Set<SocketInterface> sockets, NetAddress netAddress);

    SocketInterface findSocket(NetAddress netAddress);

    void deleteSocket(Map<NetAddress, SocketInterface> sockets, SocketInterface socket);
}
